<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>KSWeb ERP</title>
    <link rel="stylesheet" type="text/css" href="__EASYUI__/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="__EASYUI__/themes/icon.css">
    <script type="text/javascript" src="__EASYUI__/jquery.min.js"></script>
    <script type="text/javascript" src="__EASYUI__/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="__EASYUI__/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
<div class="easyui-panel" title="EasyOit Soft" style="width: 420px; padding: 25px 30px 13px;">
    <form id="ff" method="post">
        <table cellpadding="5">
            <tr>
                <td>{:lang('切换语言')}：</td>
                <td><a href="?lang=zh-ch">{:lang('简体中文')}</a> | <a href="?lang=en-us">{:lang('英文')}</a></td>
            </tr>
            <tr>
                <td>{:lang('账号')}:</td>
                <td><input id="account" name="account" class="easyui-validatebox" type="text"
                           data-options="required:true"></input></td>
                <td>
                    <div id="account_info"></div>
                </td>
            </tr>
            <tr>
                <td>{:lang('密码')}:</td>
                <td><input id="password" name="password" class="easyui-validatebox" type="password"
                           data-options="required:true"></input></td>
                <td>
                    <div id="password_info"></div>
                </td>
            </tr>
        </table>
        <div style="text-align:center;padding:5px">
            <input id="login" type="button" value="{:lang('登陆')}"/>
            <input type="button" value="{:lang('清空')}"/>
        </div>
    </form>
</div>
<p style="color:red;"> 角色: 操作员 账号: admin 密码: admin</p>
<!--<img src="__STATIC__/images/2wm.jpg" width="200" height="200" border="0" alt="">-->

<div class="container clearfix">
    <div class="privacy pull-left">
        &copy; 2016 | KypeeSoft : Design | <a href="http://twitter.github.com/bootstrap/" target="_blank">Bootstrap</a> 粤ICP备15060407号
        <script id="ebsgovicon" src="https://szcert.ebs.org.cn/govicons.js?id=a37248af-6064-4e92-b52a-e8c483ba7556&width=26&height=36&type=1" type="text/javascript" charset="utf-8"></script>
    </div>
</div>
</body>

<script language="javascript">
    $(document).ready(function () {
        $('#account').focus();

        $('#login').bind('click', function () {
            $.messager.progress();	// 显示一个进度条
            /*
             $('#ff').form('submit', {
             url: "__URL__/login",
             onSubmit: function () {
             var isValid = $(this).form('validate');
             if (!isValid) {
             $.messager.progress('close');	// 当form不合法的时候隐藏工具条
             }
             return isValid;	// 返回false将停止form提交
             },
             success: function (data) {
             $.messager.progress('close');	// 当成功提交之后隐藏进度条
             // 跳转到操作主页
             console.log(data);
             }
             });
             */
            var isValid = $('#ff').form('validate');
            if (isValid == false) {
                $.messager.progress('close');	// 当form不合法的时候隐藏工具条
                return;
            }
            $.post("__URL__/login", $("#ff").serialize(), function (data) {
                $.messager.progress('close');	// 当form不合法的时候隐藏工具条
                if (data.code == 0) {
                    $.messager.alert('{:lang("提示")}', data.msg);
                }
                if (data.code == 1) {
                    window.location.href = data.url;
                }
            });
        });
    });
</script>

</html>

